package com.guoyw.springboot.shardingsphere.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_order_item")
public class OrderItem implements Serializable {
    
    private static final long serialVersionUID = 263434701950670170L;
    
    @TableId(value = "order_item_id",type = IdType.AUTO)
    private long orderItemId;
    
    @TableField("order_id")
    private long orderId;
    
    @TableField("user_id")
    private int userId;
    
    @TableField("status")
    private String status;
    
    
    @Override
    public String toString() {
        return String.format("order_item_id:%s, order_id: %s, user_id: %s, status: %s", orderItemId, orderId, userId, status);
    }
}
